If (isServer) then {
	
	// RUNWAY LIGHTS
	// _pos = [5249.01,2188.07,0];
	// _pos = [5264.23,2213.9,0];
	
	_pos_R_x = 5249.01;
	_pos_R_y = 2188.07;
	_pos_L_x = 5264.23;
	_pos_L_y = 2213.9;
	for [{_i = 15},{_i <= 660}, {_i = _i + 15}] do {
		_pos_x = _pos_R_x - (_i * (cos 30));
		_pos_y = _pos_R_y + (_i * (sin 30));
		_pos = [_pos_x, _pos_y, 0];
		_light = "Land_runway_edgelight" createVehicle _pos;
		_light allowDamage false;
		_light setPos _pos;
		_light switchLight "ON";
		_light setDir 30;
		
		_pos_x = _pos_L_x - (_i * (cos 30));
		_pos_y = _pos_L_y + (_i * (sin 30));
		_pos = [_pos_x, _pos_y, 0];
		_light = "Land_runway_edgelight" createVehicle _pos;
		_light allowDamage false;
		_light setPos _pos;
		_light switchLight "ON";
		_light setDir 30;		
	};
	
	// PAPI LIGHTS
	_pos = [5249.86,2160.13,0];
	_light = "Land_Runway_PAPI_4" createVehicle _pos;
	_light setPos _pos;
	_light allowDamage false;
	_light switchLight "ON";
	_light setDir 300;
	_pos = [5253.58,2166.63,0];
	_light = "Land_Runway_PAPI_3" createVehicle _pos;
	_light setPos _pos;
	_light allowDamage false;
	_light switchLight "ON";
	_light setDir 300;
	_pos = [5256.14,2170.98,0];
	_light = "Land_Runway_PAPI_2" createVehicle _pos;
	_light setPos _pos;
	_light allowDamage false;
	_light switchLight "ON";
	_light setDir 300;
	_pos = [5259.82,2177.49,0];
	_light = "Land_Runway_PAPI" createVehicle _pos;
	_light setPos _pos;
	_light allowDamage false;
	_light switchLight "ON";
	_light setDir 300;
	
	// NAVI LIGHTS
	_pos = [5259.07,2205.44,-0.2];
	_light = "Land_NavigLight" createVehicle _pos;
	_light setPosASL _pos;
	_light allowDamage false;
	_light switchLight "ON";
	_light setDir 30;
	_pos = [5254.13,2196.66,-0.2];
	_light = "Land_NavigLight" createVehicle _pos;
	_light allowDamage false;
	_light setPosASL _pos;
	_light switchLight "ON";
	_light setDir 30;
	
	_pos_start = [(5254.13 + ((5259.07 - 5254.13) / 2)), (2196.66 + ((2205.44 - 2196.66)/2)), -0.2];
	_light = "Land_NavigLight" createVehicle _pos_start;
	_light setPosASL _pos_start;
	_light allowDamage false;
	_light switchLight "ON";
	_light setDir 30;
	_pos_R_x = _pos_start select 0;
	_pos_R_y = _pos_start select 1;
	for [{_i = 5},{_i <= 40}, {_i = _i + 5}] do {
		_pos_x = _pos_R_x + (_i * (cos 30));
		_pos_y = _pos_R_y - (_i * (sin 30));
		_pos = [_pos_x, _pos_y, (_pos_start select 2)];
		_light = "Land_NavigLight" createVehicle _pos;
		_light setPosASL _pos;
		_light allowDamage false;
		_light switchLight "ON";
		_light setDir 30;
	};
	
	_pos_R_x = _pos_start select 0;
	_pos_R_y = _pos_start select 1;
	_pos_start = [(_pos_R_x - (750 * (cos 30))), (_pos_R_y + (750 * (sin 30))), 8.0];
	_light = "Land_NavigLight" createVehicle _pos_start;
	_light setPosASL _pos_start;
	_light allowDamage false;
	_light switchLight "ON";
	_light setDir 30;
	_pos_R_x = _pos_start select 0;
	_pos_R_y = _pos_start select 1;
	for [{_i = 5},{_i <= 25}, {_i = _i + 5}] do {
		_pos_x = _pos_R_x + (_i * (cos 60));
		_pos_y = _pos_R_y + (_i * (sin 60));
		_pos = [_pos_x, _pos_y, ((_pos_start select 2) - (_i / 5))];
		_light = "Land_NavigLight" createVehicle _pos;
		_light setPosASL _pos;
		_light allowDamage false;
		_light switchLight "ON";
		_light setDir 30;

		_pos_x = _pos_R_x - (_i * (cos 60));
		_pos_y = _pos_R_y - (_i * (sin 60));
		_pos = [_pos_x, _pos_y, ((_pos_start select 2) - (_i / 5))];
		_light = "Land_NavigLight" createVehicle _pos;
		_light setPosASL _pos;
		_light allowDamage false;
		_light switchLight "ON";
		_light setDir 30;
	};
};
waituntil {sleep 3.1234; !isnil "X_INIT"};
If (X_Client) then {
	_fncLights = {
		_extinction = _this getVariable "extinction";
		if (isnil "_extinction") then { _extinction = time - 10;};
		// This means it was already triggered, we just increase the waiting time.
		if (_extinction > time) exitWith { _this setVariable ["extinction", (time + 600)];};
		_this setVariable ["extinction", (time + 600)];
		_light = _this getVariable "building_light";
		_light setlightbrightness 0;
		waituntil { sleep 10; (_this getVariable "extinction") < time};
		_light setlightbrightness 0.007;
	};

	// FLAG LIGHT
	_pos = getPos FLAG_BASE;
	_pos set [2,4];
	_light1 = "#lightpoint" createVehicleLocal _pos;
	_light1 setlightcolor [100,100,20];
	_light1 setlightambient [0.4,0.4,0.1];
	_light1 setlightbrightness 0.005;

	// VEHICLES HANGAR 1
	_pos = [5117.97,2366.98,4];
	_light1 = "#lightpoint" createVehicleLocal _pos;
	_light1 setlightcolor [100,100,20];
	_light1 setlightambient [0.4,0.4,0.1];
	_light1 setlightbrightness 0.005;

	// VEHICLES HANGAR 1
	_pos = [5156.83,2376.99,4];
	_light1 = "#lightpoint" createVehicleLocal _pos;
	_light1 setlightcolor [100,100,20];
	_light1 setlightambient [0.4,0.4,0.1];
	_light1 setlightbrightness 0.005;

	// AMMO POINT
	_pos = [5010.09,2292.36,2];
	_light1 = "#lightpoint" createVehicleLocal _pos;
	_light1 setlightcolor [100,100,20];
	_light1 setlightambient [0.4,0.4,0.1];
	_light1 setlightbrightness 0.005;

	// JET SERVICE
	_pos = [4839.75,2376.02,2];
	_light1 = "#lightpoint" createVehicleLocal _pos;
	_light1 setlightcolor [100,100,20];
	_light1 setlightambient [0.4,0.4,0.1];
	_light1 setlightbrightness 0.005;

	// JET SERVICE
	_pos = [4839.75,2376.02,2];
	_light1 = "#lightpoint" createVehicleLocal _pos;
	_light1 setlightcolor [100,100,20];
	_light1 setlightambient [0.4,0.4,0.1];
	_light1 setlightbrightness 0.005;

	// HANGAR 1
	_pos = [4792.47,2575.85,8];
	_light1 = "#lightpoint" createVehicleLocal _pos;
	_light1 setlightcolor [100,100,40];
	_light1 setlightambient [0.4,0.4,0.1];
	_light1 setlightbrightness 0.02;
	
	// HANGAR 2
	_pos = [4756.70,2596.23,8];
	_light1 = "#lightpoint" createVehicleLocal _pos;
	_light1 setlightcolor [100,100,40];
	_light1 setlightambient [0.4,0.4,0.1];
	_light1 setlightbrightness 0.02;

	// TOWER
	_pos = [4718.13,2595.94,2];
	_tower = nearestObject [_pos,"Land_Mil_ControlTower"];
	if (!isnull _tower) then {
		_light1 = "#lightpoint" createVehicleLocal _pos;
		_light1 setlightcolor [100,100,60];
		_light1 setlightambient [0.4,0.4,0.1];
		_light1 setlightbrightness 0.007;
		_light1 setPosATL [4718.13,2595.94,10.584];
		_tower setVariable ["building_light",_light1];
		_tower setVariable ["fnc_handler",_fncLights];
		_tower setVariable ["extinction", 0];
		_tower addEventHandler ["HandleDamage",{_fnc = (_this select 0) getVariable "fnc_handler";(_this select 0) spawn _fnc;}];
	};

	if (!isNil "MissionStartTeleporter") then {
		_pos = getPos MissionStartTeleporter;
		_pos set [2, 8];
		_light1 = "#lightpoint" createVehicleLocal _pos;
		_light1 setlightcolor [100,40,30];
		_light1 setlightambient [0.4,0.4,0.1];
		_light1 setlightbrightness 0.02;
	};
	
	// _strobe1 = "#particlesource" createVehicleLocal _pos;
	// _strobe1 setParticleCircle [0, [0, 0, 0]];
	// _strobe1 setParticleRandom [0, [0, 0, 0], [0, 0, 0], 0, 0.25, [0, 0, 0, 0.1], 0, 0];
	// _strobe1 setParticleParams [["ca\data\particleeffects\Universal\Universal", 16, 14, 0, 0], "", "Billboard", 1, 0.02, [0,0,0], [0, 0, 0], 0, 10, 7.9, 0.01, [0.1,0.1,0.1,0], [[1, 0, 0,1],[1, 0, 0,1]], [1000,0], 1, 0, "", "", _light1];
	// _strobe1 setdropinterval 0.01;

	_fallen_tower = [5134.38,2390.34,0] nearestObject 345071;
	if (!isnil "_fallen_tower") then {
		_fallen_tower hideObject true;
	};
};